package com.example.x.dnuifood_929dx.model;

import com.example.x.dnuifood_929dx.iface.Shopiface;
import com.example.x.dnuifood_929dx.listener.onRetrofitListener;
import com.example.x.dnuifood_929dx.service.ShopService;

import retrofit2.Call;

/**
 * Created by X on 2018/10/29.
 */

public class ShopModel extends BaseModel implements Shopiface {

    private ShopService shopService;
    private String flag;

    public ShopModel(){
        shopService=retrofit.create(ShopService.class);

    }
    public  void  getAllShops(onRetrofitListener listener){
        Call call=shopService.getAllshops();
        bindCallback(call,listener,1);
    }

    @Override
    public void getFoodByShop(String shop_id, onRetrofitListener listener) {
        Call call=shopService.getFoodByShop(shop_id);
        bindCallback(call,listener,2);
    }


    @Override
    public void isCollected(String user_id, String shop_food_id, String flag, onRetrofitListener listener) {
        Call call=shopService.isCollected(user_id,shop_food_id,flag);
        bindCallback(call,listener,3);
    }

    @Override
    public void userCollectShop(String user_id, String shop_id, onRetrofitListener listener) {
        Call call=shopService.userCollectShop(user_id,shop_id);
        bindCallback(call,listener,4);
    }
}